import { IEventHandler } from './../../event/IEventHandler';
import { _decorator, Component,Node, Vec2, v3, Vec3 } from "cc";
import { CompositeDisposable } from '../../event/EventKit';
import { JoystickEvent } from './events/JoystickEvent';

const { ccclass, menu, property } = _decorator;

@ccclass
/**虚拟摇杆组件 */
export default class RoleTest extends Component implements IEventHandler {


    private speed:Vec3 = v3(1,1,1)



    disposable: CompositeDisposable;
    disposeEvent(): void {
        this.disposable && this.disposable.dispose();
    }
    registEvent(): void {
        this.disposable = new CompositeDisposable();
        this.disposable.add(JoystickEvent.ON_JOYSTICK_MOVE.on(this.onMove.bind(this)))
    }

    onLoad(){

    }

    onDestory(){
        this.disposeEvent();
    }

    start(){
        this.registEvent();
    }

    onMove(dir:Vec2,isInnerCircle:boolean){
    }

}